﻿<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             x:Class="Sanctuary.App"
             >
    <Application.Resources>
        <Style x:Key="flatButton" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}">
                            <ContentPresenter HorizontalAlignment="Center" Margin="4,0,4,0" Content="{TemplateBinding Content}" VerticalAlignment="Center" />
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="GlassBorderStyle" TargetType="Border">
            <Setter Property="BorderThickness" Value="4"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.75,1" StartPoint="0.25,0">
                        <GradientStop Color="#33FFFFFF" Offset="0"/>
                        <GradientStop Color="#C0FFFFFF" Offset="0.287"/>
                        <GradientStop Color="#4011322D" Offset="0.683"/>
                        <GradientStop Color="#33FFFFFF" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#5811322D" Offset="0"/>
                        <GradientStop Color="#3EFFFFFF" Offset="0.25"/>
                        <GradientStop Color="#FFFFFFFF" Offset="0.5"/>
                        <GradientStop Color="#3EFFFFFF" Offset="0.75"/>
                        <GradientStop Color="#BFFFFFFF" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Effect">
                <Setter.Value>
                    <DropShadowEffect BlurRadius="3" ShadowDepth="3" Opacity="0.5"/>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="StripedBackground" EndPoint="1.5,1.5" MappingMode="Absolute" SpreadMethod="Repeat" StartPoint="0,0">
            <GradientStop Color="Black"/>
            <GradientStop Color="Gray" Offset="0.526"/>
            <GradientStop Color="Transparent" Offset="0.544"/>
            <GradientStop Color="Transparent" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ButtonStripedBackground" EndPoint="1.5,1.5" MappingMode="Absolute" SpreadMethod="Repeat" StartPoint="0,0">
            <GradientStop Color="Turquoise"/>
            <GradientStop Color="DarkGreen" Offset="0.526"/>
            <GradientStop Color="Transparent" Offset="1"/>

        </LinearGradientBrush>
        <LinearGradientBrush x:Key="FontGradientBrush" StartPoint="0.5,0" EndPoint="0.5,1" >
            <GradientStop Color="WhiteSmoke" Offset="0" />
            <GradientStop Color="Yellow" Offset="1" />
        </LinearGradientBrush>
        <DropShadowEffect x:Key="TextDropShadow" ShadowDepth="2" Color="Black"/>
        <Style TargetType="TextBlock" x:Key="CustomGradientText">
            <Setter Property="Foreground" Value="{StaticResource FontGradientBrush}" />
            <Setter Property="FontFamily" Value="Courier New" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="FontSize" Value="22" />
            <Setter Property="Effect" Value="{StaticResource TextDropShadow}" />
        </Style>
        <Style TargetType="Button" x:Key="GelButton">
            <Setter Property="Background" Value="{StaticResource ButtonStripedBackground}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid x:Name="RootElement">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <!--VisualState Focused-->
                                    <VisualState x:Name="Focused" />
                                    <!--VisualState Unfocused-->
                                    <VisualState x:Name="Unfocused" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="00:00:00" />
                                        <VisualTransition From="Normal" GeneratedDuration="00:00:00.2000000" To="MouseOver" />
                                        <VisualTransition From="MouseOver" GeneratedDuration="00:00:00.2000000" To="Normal" />
                                    </VisualStateGroup.Transitions>
                                    <!--VisualState Normal-->
                                    <VisualState x:Name="Normal" />
                                    <!--VisualState MouseOver-->
                                    <VisualState x:Name="MouseOver" >
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="mainRect" 
                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:05" Value="HotPink"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <!--VisualState Pressed-->
                                    <VisualState x:Name="Pressed" >
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="mainRect" 
                                                                          Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:05" Value="HotPink"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <!--VisualState Disabled-->
                                    <VisualState x:Name="Disabled" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Rectangle Fill="#40000000" Margin="2,2,0,0" />
                            <Border Name="border" CornerRadius="5" Style="{StaticResource GlassBorderStyle}" >
                                <Grid x:Name="mainButton" Margin="0,0,1,1" RenderTransformOrigin="0.5,0.5">
                                    <Grid.RenderTransform>
                                        <TransformGroup>
                                            <TranslateTransform x:Name="MainButtonTranslate" X="0.0" Y="0.0"/>
                                            <ScaleTransform x:Name="MainButtonScale" ScaleX="1.0" ScaleY="1.0" />
                                        </TransformGroup>
                                    </Grid.RenderTransform>

                                    <Rectangle x:Name="mainRect" Fill="{TemplateBinding Background}" ></Rectangle>

                                    <Rectangle x:Name="glowRect" Margin="1,1,1,1">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                                <GradientStop Offset="0" Color="#DFFFFFFF"/>
                                                <GradientStop Offset="1" Color="#00FFFFFF"/>
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                    <ContentPresenter HorizontalAlignment="Center" Margin="4,0,4,0" Content="{TemplateBinding Content}" VerticalAlignment="Center" />
                                </Grid>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
</Application>
